extends "../i_bangled25_Hide/i_bangled25_Hide.gd"

func init():
	.init()
	name = "毒手镯·爆"
	resetdata()
	info = "万毒源体：[主动]为所有敌人附加1层<毒种>[cd:4秒][被动]所有攻击20%概率使被攻击者十字范围内的队友附加1层<毒种>\n" + info

func _connect():
	._connect()
	masCha.connect("onAtkChara",self,"addbing2")

func _upS():
	._upS()
	cnt3 += 1
	if cnt3 == 4:
		cnt3 = 0
		var lf = 6
		if masCha.hasBuff("DY"):lf = 10
		var chas = masCha.getAllChas(1)
		for i in chas:
			var bf = i.hasBuff("b_duzhong")
			if !bf:
				i.addBuff(ctrl.b_duzhong.new(lf,1))
			else:
				bf.cnt += 1
				bf.life += lf
				if bf.cnt >= 9:
					bf.isDel = true
					masCha.hurtChara(i,masCha.att.atk * 1.88,Chara.HurtType.REAL,Chara.AtkType.EFF)
					

func addbing2(atkinfo):
	if atkinfo.hitCha != target && target != null:return
	if atkinfo.isMiss || atkinfo.atkType == Chara.AtkType.EFF:return
	if sys.rndPer(20):
		var lf = 6
		if masCha.hasBuff("DY"):lf = 10
		var chas = atkinfo.hitCha.getCellChas(atkinfo.hitCha.cell,1,2)
		for i in chas:
			if i == atkinfo.hitCha:continue
			var bf = i.hasBuff("b_duzhong")
			if !bf:
				i.addBuff(ctrl.b_duzhong.new(lf,1))
			else:
				bf.cnt += 1
				bf.life += lf
				if bf.cnt >= 9:
					bf.isDel = true
					masCha.hurtChara(i,masCha.att.atk * 1.88,Chara.HurtType.REAL,Chara.AtkType.EFF)
					